﻿using UnityEngine;
using System.Collections;

public class MoveTrigger : MonoBehaviour
{

    public Transform currentBg;

    public Pipe pipe1;

    public Pipe pipe2;
    void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Player")
        {
            Transform firstBg = GameManage._intance.firstBg;
           
            currentBg.position = new Vector3(firstBg.position.x + 10, currentBg.position.y, currentBg.position.z);
            Debug.Log("OnTriggerEnter");
            GameManage._intance.firstBg = currentBg;

            pipe1.RandPositon();
            pipe2.RandPositon();
        }
        
    }
}
